package com.ssss.property;


public class CloneTest {

    public static void main(String[] args) throws CloneNotSupportedException {
        Teather teather = new Teather();
        teather.setName("张蝶");
        teather.setAge(32);

        Book book = new Book();
        book.setName("语文");
        teather.setBook(book);

        Teather cloneTeather = (Teather) teather.clone();
        book.setName("数学");
        teather.setName("张一柠");
        cloneTeather.setAge(1);
        System.out.println("t:"+teather);
        System.out.println("ct:"+cloneTeather);
        System.out.println("book:" + teather.getBook().equals(cloneTeather.getBook()));
    }
}
